package com.zc.gateway.verticle;

import io.vertx.core.Vertx;
import io.vertx.ext.web.Router;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.ApplicationContext;

/**
 * @Name: HttpRouter
 * @Author: Neil.Zhou
 * @Version: V1.00
 * @CreateDate: 2016/06/14
 * @Description: Http Router Register
 */
public class HttpRouter{
    private static final Logger log = LogManager.getLogger(HttpRouter.class.getName());
    private Vertx vertx;
    public HttpRouter(ApplicationContext context,Vertx vertx) {
        this.vertx=vertx;
    }

    /**
     * 转发组件
     * @param router
     * @throws Exception
     */
    public void routerHandle(Router router) throws Exception {
        log.info("============== GateWay ==============");
        router.route().handler(ctx->{
                ctx.next();
        });
    }
}